package com.applet.mallappletbackstage.controller;


import com.applet.mallappletbackstage.entity.IsShow;
import com.applet.mallappletbackstage.service.IsShowService;
import com.applet.mallappletbackstage.utils.R;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author X
 * @since 2020-08-11
 */
@RestController
@RequestMapping("/mallappletbackstage/is-show")
public class IsShowController {
    @Autowired
    private IsShowService isShowService;

    /***
     * 改变变量
     * @param isShow
     * @return
     */
    @PostMapping("/updata/isShow/{isShow}")
    public R isShow(@PathVariable(value = "isShow") Integer isShow) {
        int count = isShowService.isShow(isShow);
        if (count>0){
            return R.success("修改成功");
        }
        return R.fail("修改失败");
    }

    /***
     * 查询版本
     * @return
     */
    @GetMapping("/select/isShow")
    public R selectIsShow(){
       IsShow isShow = isShowService.selectIsShow();
        return R.success(isShow);
    }
}

